//
//  GameLevelTopInfo.m
//  iMine
//
//  Created by gaoxiang on 09-3-30.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "GameLevelTopInfo.h"


@implementation GameLevelTopInfo

@synthesize levelName, levelValue, scoreInfos;

- (id)initWithLevelName:(NSString *)name andLevelValue:(int)value andScoreInfos:(NSMutableArray *)infos
{
	if (![super init])
		return nil;
	
	levelName = name;
	levelValue = value;
	scoreInfos = infos;
	
	return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
	[coder encodeObject:levelName forKey:@"levelName"];
	[coder encodeInt:levelValue forKey:@"levelValue"];
	[coder encodeObject:scoreInfos forKey:@"scoreInfos"];
}

- (id)initWithCoder:(NSCoder *)coder
{
	[super init];
	levelName = [[coder decodeObjectForKey:@"levelName"] retain];
	levelValue = [coder decodeIntForKey:@"levelValue"];
	scoreInfos = [[coder decodeObjectForKey:@"scoreInfos"] retain];
	
	return self;
}

- (void)dealloc
{
	[levelName release];
	[scoreInfos release];
	[super dealloc];
}

@end
